// Copyright (c) Symbian Ltd 2008. All rights reserved.

#include "rpsPlayTimer.h"
#include "rpsGameScreens.h"

CPlayTimer* CPlayTimer::NewL(TTimeIntervalMicroSeconds32 aInterval, CPlayScreen& aPlayScreen)
	{
	CPlayTimer* me = new (ELeave) CPlayTimer(aInterval, aPlayScreen);
	CleanupStack::PushL(me);
	me->ConstructL();
	CleanupStack::Pop(me);
	return (me);
	}

CPlayTimer::~CPlayTimer()
	{
	Cancel();
	}

void CPlayTimer::Start()
	{
	After(iInterval);
	}

void CPlayTimer::RunL()
	{
	iPlayScreen.PlayTimeout();
	}

CPlayTimer::CPlayTimer(TTimeIntervalMicroSeconds32 aInterval, CPlayScreen& aPlayScreen)
: CTimer(CActive::EPriorityStandard), iInterval(aInterval), iPlayScreen(aPlayScreen)
	{
	CActiveScheduler::Add(this);
	}
